<!DOCTYPE html>

<html>
	<head>
		{{template "bootstrap"}}
		<title> 服务器管理 </title>
		
	</head>

	<body style="padding-top:80px">
  		{{template "nav" .}}

		<div class="container">
			<h1> 服务器类型 <h1>
			<a href="/smanager/addtype" class="btn btn-default">添加类型</a>
			<table class="table table-striped">
				<thead>
					<th>#</th>
					<th>类型</th>
					<th>描述</th>
					<th>增加Server</th>
					<th>删除该类Server</th>
				</thead>

				<tbody>
					{{range .STypes}}
					<tr>
						<td>{{.Id}}</th>
						<td>{{.Name}}</th>
						<td>{{.Desc}}</th>
						<td>
							<a href="/smanager/addserver?stype={{.Id}}">添加server </a>
						<td>
							<a href="/smanager/deltype?id={{.Id}}"> 删除 </a>
						</td>
					</tr>
					{{end}}
				</tbody>
			</table>

		</div>

		<script type="text/javascript">

			function checkInput(){
				var name = document.getElementById("name");
				if (name.value.length == 0) {
					alert("请输入类型名称")
					return false
				}
				
				var desc = document.getElementById("desc");
				if (desc.value.length == 0) {
					alert("请输入类型描述")
					return false
				}

				return true
			}

			function backToHome() {
				window.location.href = "/"
				return false
			}
		</script>
	</body>
</html>